package xin.printk.android.module.plan;

import xin.printk.android.utils.RequestCallback;

public class AddPlanPresenter implements AddPlanContract.Presenter {

    private AddPlanContract.View mView;

    public AddPlanPresenter(AddPlanContract.View view) {
        mView = view;
    }

    @Override
    public void addPlan() {
        PlanModel.addPlan(mView.getContext(), mView.getPlan(), new RequestCallback() {

            @Override
            public <T> void onSuccess(T t) {
                mView.add();
            }

            @Override
            public void onFailure(String message) {
                mView.showError(message);
            }
        });
    }
}
